Code Example of Checking if a variable is None using is operator

27

# Declaring a None variable
var = None

if var is None: # Checking if the variable is None
  print("None")
else:
  print("Not None")

Comments

Submit
0 Comments